﻿using System;
using Autodesk.Revit.DB.Electrical;
using HYElectricSetting;

namespace Model
{
	public class SConduitTypeData
	{
		public SConduitTypeData(double dRadius, ConduitType elem = null)
		{
			this.m_elemConduitType = elem;
			this.m_dRadius = dRadius;
		}

		public SConduitTypeData(double dRadius, RevitConduitType cType, ConduitType elem = null)
		{
			this.ConduitType = cType;
			this.m_elemConduitType = elem;
			this.m_dRadius = dRadius;
		}

		public ConduitType elemConduitType
		{
			get
			{
				return this.m_elemConduitType;
			}
		}

		public double Radius
		{
			get
			{
				return this.m_dRadius;
			}
			set
			{
				this.m_dRadius = value;
			}
		}

		public string Name
		{
			get
			{
				if (this.m_elemConduitType == null)
				{
					return "";
				}
				return this.m_elemConduitType.Name;
			}
		}

		public override bool Equals(object obj)
		{
			if (obj == null)
			{
				return false;
			}
			SConduitTypeData sconduitTypeData = obj as SConduitTypeData;
			return sconduitTypeData != null && this.Equals(sconduitTypeData);
		}

		public override int GetHashCode()
		{
			return this.m_elemConduitType.GetHashCode();
		}

		public override string ToString()
		{
			return this.Name;
		}

		private bool Equals(SConduitTypeData other)
		{
			return other != null && string.Compare(this.m_elemConduitType.Name, other.m_elemConduitType.Name, true) == 0;
		}

		public RevitConduitType ConduitType;

		private ConduitType m_elemConduitType;

		private double m_dRadius;
	}
}
